In an object oriented software runtime environment, such as a Java environment (Java is a registered trademark of Sun Microsystems Inc.), software objects can be serialized from a runtime state to a serialized state. Such serialization involves recording a serialized form of an object to a storage medium. Such a serialized form can include a serial binary representation of an object. Serialization is useful since it provides a mechanism for recording instantiated software objects in such a way that the objects can be communicated between or within applications, between runtime environments or between physical devices such as computer systems. Such serialized objects can be deserialized to a runtime state. In order to achieve deserialization, a definition is required of an implementing class of which a serialized object is an instance. In a standard runtime environment such implementing class definitions are normally available to facilitate deserialization and can be loaded by a class loader as required. In some other environments, however, access to such class definitions can be problematic.
One such other environment is a class loading delegation network, such as that found in a module system such as the Open Services Gateway initiative (OSGi) framework (OSGi is a registered trademark of the OSGi Alliance). OSGi is a Java module system providing for the componentization of Java applications into software components. In OSGi, such software components are known as ‘bundles’ and can be implemented in Java archive files known as JAR files. Software components in such a class loading delegation network interoperate by exporting, and respectively importing, resources such as classes, interfaces and packages. For example, a first software component in such a system can export an interface definition for use by classes defined in a second software component in the system. Each software component has associated a class loader which is operable to load a class for use by the software component. A software component deserializing an object in such a class loading delegation network will require access to the implementing class for the object. In the event that the implementing class is not available within the software component the component may be unable to successfully deserialize the object.
One solution to overcome this problem is to make the definition of serializable classes specifically available to software components in such a class loading delegation network. For example, in OSGi it is possible for a software component to provide a ‘service’, such as access to objects, to other software components. In this way, a class definition for an implementing class can be made available to software components for the purpose of deserializing objects. However, this approach has the significant drawback that software component code is required to change to support the use of such services as part of the deserialization process.
It would therefore be advantageous to provide for the deserialization of a serialized software object in a class loading delegation network such as a module system without requiring changes to software component code for the deserialization.